


/**
 * 客户Id打电话
 * @param id  业务ID,不能为空
 * @param customerName  客户名字,不能为空
 * @param phone 解密后的电话号码,不能为空
 * @param callBackUrl  回调地址,可以为空
 */
function callPhone(id,customerName,phone,callBackUrl) {
    if (checkIsEmpty(id)){
        DGG.Warning("业务ID不能为空!");
        return false;
    }
    if (checkIsEmpty(customerName)){
        DGG.Warning("客户姓名不能为空!");
        return false;
    }
    if (checkIsEmpty(phone)){
        DGG.Warning("电话号码不能为空!");
        return false;
    }
    //([{id:'7707874797615218681',name:'测试一号',phoneList:[{no: "18628979860", name: "测试一号"}]}], callBackUrl, 0)
    //组装参数
    var customers = [];
    var phoneList = [];
    var phoneInfo = {no:phone,name:customerName};
    phoneList.push(phoneInfo);
    var customer = {id:id,name:customerName,phoneList:phoneList};
    customers.push(customer);
    //调用IBOSS打电话  最后一个参数 0 表示单个拨打 目前该方法只支持单个拨打
    window.parent.dialing(customers, callBackUrl, 0);
}






// 隐藏电话
function hidePhone(phoneStr) {
    if (null == phoneStr || undefined == phoneStr) {
        return
    }
    ;
    var length = phoneStr.length;
    if (length == 0) {
        return "";
    }
    if (length == 1) {
        return "*";
    }
    if (length > 10) {
        return phoneStr.substr(0, 3) + "****" + phoneStr.substr(length - 4, length);
    }
    if (length <= 10 && length > 3) {
        return phoneStr.substr(0, length - 4) + "****";
    }
    return phoneStr.substr(0, 1) + "*";
}